<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MindMate - UI界面原型</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            /* 主色调 - 智能蓝 */
            --primary-50: #eff6ff;
            --primary-100: #dbeafe;
            --primary-500: #3b82f6;
            --primary-600: #2563eb;
            --primary-700: #1d4ed8;
            
            /* 辅助色 - 温暖橙 */
            --accent-500: #f97316;
            --accent-600: #ea580c;
            
            /* 中性色 */
            --gray-50: #f8fafc;
            --gray-100: #f1f5f9;
            --gray-200: #e2e8f0;
            --gray-500: #64748b;
            --gray-700: #334155;
            --gray-900: #0f172a;
            
            /* 状态色 */
            --success: #10b981;
            --warning: #f59e0b;
            --error: #ef4444;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
            background: var(--gray-50);
            color: var(--gray-900);
            height: 100vh;
            overflow: hidden;
        }

        /* 主容器 */
        .app-container {
            display: flex;
            height: 100vh;
        }

        /* 顶部导航栏 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: white;
            border-bottom: 1px solid var(--gray-200);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            z-index: 100;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .nav-left {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 20px;
            font-weight: 600;
            color: var(--primary-600);
        }

        .logo-icon {
            font-size: 28px;
        }

        .model-selector {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: var(--gray-50);
            border: 1px solid var(--gray-200);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .model-selector:hover {
            background: var(--primary-50);
            border-color: var(--primary-500);
        }

        .model-icon {
            font-size: 20px;
        }

        .nav-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .nav-button {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .nav-button:hover {
            background: var(--gray-100);
        }

        /* 主内容区 */
        .main-content {
            display: flex;
            width: 100%;
            margin-top: 60px;
            height: calc(100vh - 60px);
        }

        /* 左侧边栏 */
        .sidebar {
            width: 280px;
            background: white;
            border-right: 1px solid var(--gray-200);
            display: flex;
            flex-direction: column;
        }

        .sidebar-header {
            padding: 16px;
            border-bottom: 1px solid var(--gray-100);
        }

        .search-box {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--gray-50);
            border: 1px solid var(--gray-200);
            border-radius: 8px;
            margin-bottom: 12px;
        }

        .search-box input {
            flex: 1;
            border: none;
            background: transparent;
            outline: none;
            font-size: 14px;
        }

        .new-chat-btn {
            width: 100%;
            padding: 10px;
            background: var(--primary-500);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .new-chat-btn:hover {
            background: var(--primary-600);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }

        .session-list {
            flex: 1;
            overflow-y: auto;
            padding: 12px;
        }

        .session-group {
            margin-bottom: 20px;
        }

        .session-group-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--gray-500);
            margin-bottom: 8px;
            padding: 0 8px;
        }

        .session-item {
            padding: 12px;
            margin-bottom: 4px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .session-item:hover {
            background: var(--gray-50);
        }

        .session-item.active {
            background: var(--primary-50);
            border-left: 3px solid var(--primary-500);
        }

        .session-title {
            font-size: 14px;
            font-weight: 500;
            color: var(--gray-900);
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .session-preview {
            font-size: 12px;
            color: var(--gray-500);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* 中央对话区 */
        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--gray-50);
        }

        .chat-header {
            height: 60px;
            background: white;
            border-bottom: 1px solid var(--gray-200);
            padding: 0 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .chat-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--gray-900);
        }

        .chat-actions {
            display: flex;
            gap: 8px;
        }

        .messages-container {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .message {
            display: flex;
            gap: 12px;
            animation: slideIn 0.3s ease-out;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .message-avatar {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
        }

        .user-avatar {
            background: var(--primary-100);
        }

        .ai-avatar {
            background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
        }

        .message-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .message-header {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .message-author {
            font-size: 14px;
            font-weight: 600;
            color: var(--gray-700);
        }

        .message-time {
            font-size: 12px;
            color: var(--gray-500);
        }

        .message-text {
            background: white;
            padding: 12px 16px;
            border-radius: 12px;
            font-size: 15px;
            line-height: 1.6;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .message.user .message-text {
            background: var(--primary-500);
            color: white;
            margin-left: auto;
            max-width: 70%;
        }

        .message.assistant .message-text {
            background: white;
            max-width: 85%;
        }

        .message-actions {
            display: flex;
            gap: 8px;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .message:hover .message-actions {
            opacity: 1;
        }

        .message-action-btn {
            padding: 4px 8px;
            background: transparent;
            border: 1px solid var(--gray-200);
            border-radius: 6px;
            font-size: 12px;
            color: var(--gray-600);
            cursor: pointer;
            transition: all 0.2s;
        }

        .message-action-btn:hover {
            background: var(--gray-50);
            border-color: var(--gray-300);
        }

        /* AI思考指示器 */
        .thinking-indicator {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .thinking-dots {
            display: flex;
            gap: 4px;
        }

        .thinking-dot {
            width: 8px;
            height: 8px;
            background: var(--primary-500);
            border-radius: 50%;
            animation: thinking 1.4s infinite ease-in-out;
        }

        .thinking-dot:nth-child(2) {
            animation-delay: -0.32s;
        }

        .thinking-dot:nth-child(3) {
            animation-delay: -0.16s;
        }

        @keyframes thinking {
            0%, 80%, 100% {
                opacity: 0.4;
                transform: scale(1);
            }
            40% {
                opacity: 1;
                transform: scale(1.2);
            }
        }

        /* 搜索结果卡片 */
        .search-results {
            background: var(--success);
            background: linear-gradient(135deg, var(--success), #059669);
            color: white;
            padding: 12px 16px;
            border-radius: 12px;
            margin: 12px 0;
        }

        .search-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            font-size: 14px;
            font-weight: 500;
        }

        .search-cards {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            padding-bottom: 8px;
        }

        .search-card {
            background: white;
            color: var(--gray-900);
            padding: 12px;
            border-radius: 8px;
            min-width: 250px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .search-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .search-card-title {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
            color: var(--gray-900);
        }

        .search-card-snippet {
            font-size: 12px;
            color: var(--gray-600);
            line-height: 1.4;
            margin-bottom: 8px;
        }

        .search-card-source {
            font-size: 11px;
            color: var(--gray-500);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* 输入区域 */
        .input-container {
            padding: 20px 24px;
            background: white;
            border-top: 1px solid var(--gray-200);
        }

        .input-wrapper {
            display: flex;
            gap: 12px;
            align-items: flex-end;
        }

        .input-box {
            flex: 1;
            background: var(--gray-50);
            border: 2px solid var(--gray-200);
            border-radius: 16px;
            padding: 12px 16px;
            transition: all 0.2s;
            position: relative;
        }

        .input-box:focus-within {
            border-color: var(--primary-500);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .input-field {
            width: 100%;
            border: none;
            background: transparent;
            outline: none;
            font-size: 15px;
            resize: none;
            min-height: 24px;
            max-height: 120px;
        }

        .input-actions {
            display: flex;
            gap: 8px;
            margin-top: 8px;
        }

        .input-action-btn {
            padding: 6px;
            background: transparent;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            color: var(--gray-500);
        }

        .input-action-btn:hover {
            background: var(--gray-100);
            color: var(--gray-700);
        }

        .send-btn {
            width: 48px;
            height: 48px;
            background: var(--primary-500);
            color: white;
            border: none;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 20px;
        }

        .send-btn:hover:not(:disabled) {
            background: var(--primary-600);
            transform: scale(1.05);
        }

        .send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* 右侧功能面板 */
        .right-panel {
            width: 320px;
            background: white;
            border-left: 1px solid var(--gray-200);
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        .panel-section {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .panel-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--gray-700);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .panel-badge {
            padding: 2px 8px;
            background: var(--primary-100);
            color: var(--primary-600);
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;
        }

        /* 上下文状态 */
        .context-status {
            background: var(--gray-50);
            padding: 12px;
            border-radius: 8px;
        }

        .context-bar {
            height: 8px;
            background: var(--gray-200);
            border-radius: 4px;
            overflow: hidden;
            margin: 8px 0;
        }

        .context-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--success), var(--warning));
            width: 60%;
            transition: width 0.3s;
        }

        .context-stats {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--gray-600);
        }

        /* 分支管理 */
        .branch-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .branch-item {
            padding: 10px;
            background: var(--gray-50);
            border-radius: 8px;
            border-left: 3px solid var(--gray-300);
            cursor: pointer;
            transition: all 0.2s;
        }

        .branch-item:hover {
            background: var(--primary-50);
        }

        .branch-item.active {
            border-left-color: var(--primary-500);
            background: var(--primary-50);
        }

        .branch-name {
            font-size: 13px;
            font-weight: 500;
            color: var(--gray-700);
            margin-bottom: 4px;
        }

        .branch-info {
            font-size: 11px;
            color: var(--gray-500);
        }

        /* 备忘录 */
        .memo-card {
            background: var(--warning);
            background: linear-gradient(135deg, var(--warning), #d97706);
            color: white;
            padding: 12px;
            border-radius: 8px;
            font-size: 13px;
            line-height: 1.5;
        }

        .memo-title {
            font-weight: 600;
            margin-bottom: 8px;
        }

        .memo-content {
            opacity: 0.95;
            font-size: 12px;
        }

        /* 响应式设计 */
        @media (max-width: 1024px) {
            .right-panel {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                left: -280px;
                z-index: 200;
                transition: left 0.3s;
            }

            .sidebar.open {
                left: 0;
            }

            .chat-container {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <div class="top-nav">
        <div class="nav-left">
            <div class="logo">
                <span class="logo-icon">🧠</span>
                <span>MindMate</span>
            </div>
            <div class="model-selector">
                <span class="model-icon">🤖</span>
                <span>GPT-4</span>
                <span>▼</span>
            </div>
            <div class="model-selector">
                <span class="model-icon">👨‍🏫</span>
                <span>学习导师</span>
                <span>▼</span>
            </div>
        </div>
        <div class="nav-right">
            <button class="nav-button" title="搜索功能">🔍</button>
            <button class="nav-button" title="历史记录">📚</button>
            <button class="nav-button" title="设置">⚙️</button>
            <button class="nav-button" title="用户">👤</button>
        </div>
    </div>

    <!-- 主内容区 -->
    <div class="main-content">
        <!-- 左侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-header">
                <div class="search-box">
                    <span>🔍</span>
                    <input type="text" placeholder="搜索会话...">
                </div>
                <button class="new-chat-btn">
                    <span>➕</span>
                    <span>新建对话</span>
                </button>
            </div>
            <div class="session-list">
                <div class="session-group">
                    <div class="session-group-title">今天</div>
                    <div class="session-item active">
                        <div class="session-title">React性能优化讨论</div>
                        <div class="session-preview">如何优化React应用的渲染性能...</div>
                    </div>
                    <div class="session-item">
                        <div class="session-title">机器学习基础概念</div>
                        <div class="session-preview">监督学习和无监督学习的区别...</div>
                    </div>
                </div>
                <div class="session-group">
                    <div class="session-group-title">昨天</div>
                    <div class="session-item">
                        <div class="session-title">Python数据分析</div>
                        <div class="session-preview">使用Pandas处理数据的最佳实践...</div>
                    </div>
                </div>
                <div class="session-group">
                    <div class="session-group-title">本周</div>
                    <div class="session-item">
                        <div class="session-title">算法面试准备</div>
                        <div class="session-preview">动态规划问题的解题思路...</div>
                    </div>
                    <div class="session-item">
                        <div class="session-title">产品设计思维</div>
                        <div class="session-preview">用户体验设计的核心原则...</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 中央对话区 -->
        <div class="chat-container">
            <div class="chat-header">
                <div class="chat-title">React性能优化讨论</div>
                <div class="chat-actions">
                    <button class="message-action-btn">📌 固定</button>
                    <button class="message-action-btn">🌳 分支</button>
                    <button class="message-action-btn">📥 导出</button>
                </div>
            </div>

            <div class="messages-container">
                <!-- 用户消息 -->
                <div class="message user">
                    <div class="message-avatar user-avatar">👤</div>
                    <div class="message-content">
                        <div class="message-header">
                            <span class="message-author">你</span>
                            <span class="message-time">10:30</span>
                        </div>
                        <div class="message-text">
                            如何优化React应用的渲染性能？我的应用在处理大量数据时变得很慢。
                        </div>
                    </div>
                </div>

                <!-- AI消息 -->
                <div class="message assistant">
                    <div class="message-avatar ai-avatar">🤖</div>
                    <div class="message-content">
                        <div class="message-header">
                            <span class="message-author">GPT-4</span>
                            <span class="message-time">10:31</span>
                        </div>
                        <div class="message-text">
                            React性能优化是一个重要话题。让我为你介绍几个关键的优化策略：

                            <br><br>1. <strong>使用React.memo进行组件记忆化</strong>
                            <br>对于纯函数组件，使用React.memo可以避免不必要的重新渲染。

                            <br><br>2. <strong>使用useMemo和useCallback</strong>
                            <br>缓存计算结果和函数引用，减少重复计算。

                            <br><br>3. <strong>虚拟滚动</strong>
                            <br>处理大量数据时，只渲染可见区域的内容。
                        </div>
                        <div class="message-actions">
                            <button class="message-action-btn">📋 复制</button>
                            <button class="message-action-btn">✏️ 编辑</button>
                            <button class="message-action-btn">🔄 重新生成</button>
                        </div>
                    </div>
                </div>

                <!-- 搜索结果 -->
                <div class="search-results">
                    <div class="search-header">
                        <span>🔍</span>
                        <span>找到 3 个相关搜索结果</span>
                    </div>
                    <div class="search-cards">
                        <div class="search-card">
                            <div class="search-card-title">React 18性能优化指南</div>
                            <div class="search-card-snippet">最新的React 18引入了自动批处理、并发特性等...</div>
                            <div class="search-card-source">
                                <span>🔗</span>
                                <span>react.dev</span>
                            </div>
                        </div>
                        <div class="search-card">
                            <div class="search-card-title">虚拟滚动实现方案</div>
                            <div class="search-card-snippet">react-window和react-virtualized对比...</div>
                            <div class="search-card-source">
                                <span>🔗</span>
                                <span>medium.com</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 用户消息 -->
                <div class="message user">
                    <div class="message-avatar user-avatar">👤</div>
                    <div class="message-content">
                        <div class="message-header">
                            <span class="message-author">你</span>
                            <span class="message-time">10:32</span>
                        </div>
                        <div class="message-text">
                            能详细说说虚拟滚动的实现原理吗？
                        </div>
                    </div>
                </div>

                <!-- AI思考指示器 -->
                <div class="thinking-indicator">
                    <div class="message-avatar ai-avatar">🤖</div>
                    <div class="thinking-dots">
                        <div class="thinking-dot"></div>
                        <div class="thinking-dot"></div>
                        <div class="thinking-dot"></div>
                    </div>
                    <span style="font-size: 14px; color: var(--gray-600);">GPT-4 正在思考...</span>
                </div>
            </div>

            <!-- 输入区域 -->
            <div class="input-container">
                <div class="input-wrapper">
                    <div class="input-box">
                        <textarea class="input-field" placeholder="输入你的问题...按 Enter 发送，Shift+Enter 换行"></textarea>
                                <!-- 已移除：附件、语音、表情等功能（根据精简版方案） -->
                    </div>
                    <button class="send-btn">
                        ➤
                    </button>
                </div>
            </div>
        </div>

        <!-- 右侧功能面板 -->
        <div class="right-panel">
            <!-- 上下文状态 -->
            <div class="panel-section">
                <div class="panel-title">
                    <span>上下文状态</span>
                    <span class="panel-badge">12/15</span>
                </div>
                <div class="context-status">
                    <div class="context-bar">
                        <div class="context-fill"></div>
                    </div>
                    <div class="context-stats">
                        <span>已使用: 8,500 tokens</span>
                        <span>剩余: 7,500</span>
                    </div>
                </div>
            </div>

            <!-- 分支管理 -->
            <div class="panel-section">
                <div class="panel-title">
                    <span>对话分支</span>
                    <span class="panel-badge">3</span>
                </div>
                <div class="branch-list">
                    <div class="branch-item active">
                        <div class="branch-name">🌿 主分支</div>
                        <div class="branch-info">15条消息 · 当前</div>
                    </div>
                    <div class="branch-item">
                        <div class="branch-name">🌱 性能测试分支</div>
                        <div class="branch-info">8条消息 · 2小时前</div>
                    </div>
                    <div class="branch-item">
                        <div class="branch-name">🍃 代码示例分支</div>
                        <div class="branch-info">12条消息 · 昨天</div>
                    </div>
                </div>
            </div>

            <!-- 备忘录 -->
            <div class="panel-section">
                <div class="panel-title">
                    <span>智能摘要</span>
                    <span class="panel-badge">自动</span>
                </div>
                <div class="memo-card">
                    <div class="memo-title">📝 对话要点</div>
                    <div class="memo-content">
                        讨论了React性能优化的多个方面，包括组件记忆化、Hook优化、虚拟滚动等技术。重点关注了处理大量数据时的性能问题。
                    </div>
                </div>
            </div>

            <!-- 快捷操作 -->
            <div class="panel-section">
                <div class="panel-title">快捷操作</div>
                <div style="display: flex; flex-wrap: wrap; gap: 8px;">
                    <button class="message-action-btn">💾 保存</button>
                    <button class="message-action-btn">📤 分享</button>
                    <button class="message-action-btn">🔄 清空</button>
                    <button class="message-action-btn">⚙️ 设置</button>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
